package com.zf.yichat.im.mapper;

import com.zf.yichat.base.FsMapper;
import com.zf.yichat.model.RcGroupMembers;
import com.zf.yichat.model.RcGroups;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RcGroupMembersMapper extends FsMapper<RcGroupMembers> {
    List<RcGroupMembers> selectList(@Param("gid") Integer groupId);

    /**
     * 根据用户查询所在群组
     * @param userId
     * @return
     */
    List<RcGroups> queryGroupByMemberId(@Param("userId") Long userId);

    /**
     * 查询用户是否在群组内
     * @param groupId
     * @param userId
     * @return
     */
    Integer checkMemberInGroup(@Param("groupId") Integer groupId, @Param("userId") Long userId);

    /**
     * 逻辑删除群组用户
     * @param groupId
     * @param userId
     */
    void memberQuit(@Param("userId") Long userId,@Param("groupId") Integer groupId);
}